package cn.edu.tfswufe.pojo;

import java.time.LocalDate;

public class Book {
    private String bookID;            // 图书编号（主键）
    private String title;             // 书名
    private String author;            // 作者
    private String ISBN;              // 国际标准书号
    private String publisher;         // 出版社
    private LocalDate publishDate;    // 出版日期
    private String category;          // 分类
    private int stock;                // 库存数量
    private String status;            // 状态（如在库、借出、维修）

    // 无参构造函数
    public Book() {
    }

    // 全参构造函数
    public Book(String bookID, String title, String author, String ISBN,
                String publisher, LocalDate publishDate, String category,
                int stock, String status) {
        this.bookID = bookID;
        this.title = title;
        this.author = author;
        this.ISBN = ISBN;
        this.publisher = publisher;
        this.publishDate = publishDate;
        this.category = category;
        this.stock = stock;
        this.status = status;
    }

    // Getter 和 Setter 方法
    public String getBookID() {
        return bookID;
    }

    public void setBookID(String bookID) {
        this.bookID = bookID;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getISBN() {
        return ISBN;
    }

    public void setISBN(String ISBN) {
        this.ISBN = ISBN;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public LocalDate getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(LocalDate publishDate) {
        this.publishDate = publishDate;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookID='" + bookID + '\'' +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", ISBN='" + ISBN + '\'' +
                ", publisher='" + publisher + '\'' +
                ", publishDate=" + publishDate +
                ", category='" + category + '\'' +
                ", stock=" + stock +
                ", status='" + status + '\'' +
                '}';
    }
}
